package com.pmoc.framework.core.task;

import com.pmoc.framework.core.config.driver.DataClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * 检查的任务，看看Alist 里面是否有需要消费的值
 *
 * @author humdeef
 * @summary WorkTask
 * @since 2019-05-16 19:05
 */
@Component
public class CheckTask implements Runnable {

    @Autowired
    private DataClient dataClient;

    @Autowired
    private Environment environment;

    @Override
    public void run() {
        String name = environment.getProperty("spring.application.name");
        if (name != null) {
            dataClient.checkData(name);
        }
    }
}
